#ifndef MATRIX_H
#define MATRIX_H

/**
  * This class represents a Matrix with a specified size
  */

class Matrix2D {
    // Data

protected:
    int ** matrix;

    // Size of the 2D Matrix
    int size;

public:

    Matrix2D(int initSize, int initValue = 0);

    ~Matrix2D();

    Matrix2D(const Matrix2D&);

    Matrix2D & operator=(const Matrix2D &);

    int get(int i, int j) const
    {
        if ((i < size) && (j < size))
            return matrix[i][j];
        else return 0;
    }

    void set(const int i, const int j, const int value)
    {
        if ((i < size) && (j < size))
            matrix[i][j] = value;
    }

    int getSize() const { return size; }
};

#endif // MATRIX_H
